cmake_minimum_required(VERSION 3.0)

project(ASIO)

set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_COMPILER g++-13)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON) #生成json文件

# set(fileList 
#     end_point.cpp
# )

set(LIB pthread)


add_executable(sync_api sync_api.cpp async_api.cpp api_main.cpp)
target_link_libraries(sync_api ${LIB})

add_executable(sync_client sync_client.cpp)
target_link_libraries(sync_client ${LIB})
add_executable(sync_server sync_server.cpp)
target_link_libraries(sync_server ${LIB})

add_executable(async_echo_server echo_main.cpp echo_server.cpp)
target_link_libraries(async_echo_server ${LIB})

add_executable(full_duplex_echo_server full_duplex_echo_main.cpp full_duplex_echo_server.cpp)

add_executable(full_duplex_sticky_bag_echo_server full_duplex_sticky_bag_echo_main.cpp full_duplex_sticky_bag_echo_server.cpp)
add_executable(full_duplex_sticky_bag_echo_client full_duplex_sticky_bag_echo_client.cpp)

add_executable(proto_test proto_test.cpp proto_msg.pb.cc)
target_link_libraries(proto_test protobuf)

add_executable(json_test json_test.cpp)
target_link_libraries(json_test jsoncpp)

add_executable(fz_sticky_bag_echo_server fz_sticky_bag_echo_server.cpp fz_sticky_bag_echo_main.cpp)
# target_link_libraries(fz_sticky_bag_echo_server jsoncpp)

add_executable(fiber_server fiber_server.cpp)